package com.pkx.cloud.fse7.conf;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.convert.converter.Converter;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * @Description
 * @Author chenwg
 * @date 2020.11.04 16:57
 */
@Configuration
public class CustomDateConfig {
    @Bean
    public Converter<String, LocalDate> localDateConverter() {
        return new CustomDateConverter.LocalDateConvert();
    }

    @Bean
    public Converter<String, LocalDateTime> localDateTimeConvert() {
        return new CustomDateConverter.LocalDateTimeConvert();
    }

    @Bean
    public Converter<String, Date> dateConverter() {
        return new CustomDateConverter.DateConvert();
    }
}
